package guoanmaker.operator.business.model;
/**
 * 
* @ClassName: OperatorContractDownloadLog.java 
* @Description: 合同下载历史记录
* @author Cancerl
* @date 2018年1月5日
*  
 */

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.fasterxml.jackson.annotation.JsonIgnore;

import guoanmaker.operator.helper.common.abstractobj.IdEntity;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name="t_operator_contract_download_log")
public class OperatorContractDownloadLog extends IdEntity{	
	@Column(name="download_id")
	String downloadId;	//合同下载计量id  根据合同下载计量id查询合同
	
	@ManyToOne(cascade=CascadeType.REFRESH,optional=false)
	@JoinColumn(name = "user_id")
	@JsonIgnore
	private PersonalUser user;	//下载用户id

	Date date;	//下载日期
	
	String guide;

	@Transient
	String nickname;
	
	@Transient
	String phone;
	
	public String getNickname(){
		return user.getNickname();
	}
	
	public String getPhone(){
		return user.getUsername();
	}
}
